gsk: Another vbo_size overflow fix
authorMatthias Clasen <mclasen@redhat.com>
Tue, 29 Jun 2021 19:22:40 +0000 (15:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 29 Jun 2021 19:22:40 +0000 (15:22 -0400)
We can overflow vbo_size not just by batching
too much, but also by producing humongous text
nodes. Split them up.

gsk/ngl/gsknglrenderjob.c

index d08d45a04fee013d4d240b418a39e35a74d611a5..b876e6e24848a58a875863c5005b30378c93e76d 100644 (file)
@@ -2889,7 +2889,7 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob     *job,
       if G_UNLIKELY (texture_id == 0)
         continue;
 
-      if G_UNLIKELY (last_texture != texture_id)
+      if G_UNLIKELY (last_texture != texture_id || batch->draw.vbo_count + GSK_NGL_N_VERTICES > 0xffff)
         {
           if G_LIKELY (last_texture != 0)
             {